<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!-- basic styles -->
        <link href="../../assets/js/plugin/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link rel="stylesheet" href="../../assets/css/font-awesome.min.css" />
        <link type="text/css" rel="stylesheet" href="../../assets/js/plugin/jquery-ui/css/jquery-ui.css" />
        <!--<link href="../../assets/js/plugin/datepicker/css/jquery-datepicker.css" rel="stylesheet" media="screen" />-->
        <!--<link href="../../assets/js/plugin/check/check.css" rel="stylesheet" media="screen" />-->
        <link rel="stylesheet" href="../../assets/css/ace.min.css" />
        <link rel="stylesheet" type="text/css" media="all" href="../../assets/js/date-time/daterangepicker-bs3.css"/>
        <style>
            .controls span.help-inline {
                font-size: 12px;
                color: #999
            }
            .modal-body{max-height: 200px;}
            .form-horizontal .row-fluid .left{
                float: left;
                width: 50%;
                margin: 0px;
                padding: 0px;
            }
            .header{padding-left:20px; margin-top: 20px;}
            .row-fluid{border-bottom: 1px solid #d5e3ef;margin-bottom: 10px}
        </style>

    </head>

    <body>
        <div class="main-container">
            <h4 style="padding-left:20px; margin-top: 20px;" class='header smaller lighter blue'>流量分析结果上报策略添加</h4>
            <form class="form-horizontal">
                <div style="width:50%; min-width:400px; float:left;">
                    <div class="control-group">
                        <label class="control-label" for="policy_desc">策略名称:</label>
                        <div class="controls">
                            <input type="text" id="policy_desc" name="policy_desc" class="policy_desc" required>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Adv_type">推送信息类型</label>
                        <div class="controls">
                            <select class="Adv_type" id="Adv_type" >
                                <option value="1">电信自营应用</option>
                                <option value="2">主动推送第三方信息</option>
                                <option value="3">由用户访问指定Host进行触发</option>
                                <option value="4">由用户搜索关键字触发</option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Adv_WhiteHostListID">信息推送网站白名单</label>
                        <div class="controls">
                            <input type="text" class="Adv_WhiteHostListID number" id="Adv_WhiteHostListID" name="Adv_WhiteHostListID"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Trigger_HostListID">触发Host列表编号</label>
                        <div class="controls">
                            <textarea id="Trigger_HostListID" class="Trigger_HostListID tNumber" name="Trigger_HostListID"></textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Trigger_KWListID">触发关键词列表编号</label>
                        <div class="controls">
                            <textarea id="Trigger_KWListID" class="Trigger_KWListID tNumber" name="Trigger_KWListID"></textarea>
                        </div>
                    </div>
                </div>

                <div style=" width:50%; min-width:400px; float:left;">
                    <div class="control-group">
                        <label class="control-label" for="Adv_ID">推送信息的编号</label>
                        <div class="controls">
                            <input type="text" class="Adv_ID number" id="Adv_ID" name="Adv_ID" required/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="AdvFrame_URL">信息框架服务器推送的URL</label>
                        <div class="controls">
                            <input type="text" class="AdvFrame_URL" id="AdvFrame_URL" name="AdvFrame_URL" required/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Adv_Token">推送配额</label>
                        <div class="controls">
                            <input type="text" class="Adv_Token number span1" id="Adv_Token" name="Adv_Token" required/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Adv_Delay">信息推送延迟时间</label>
                        <div class="controls">
                            <input type="text" class="Adv_Delay numbers span1" id="Adv_Delay" name="Adv_Delay" value="0" required/>
                            <span style="color:#858585">取值范围0-255,0表示触发条件满足则立即触发，1-255表示触发条件满足后延时推送秒数</span>
                        </div>
                    </div>                    
                </div>
                <div style=" width:100%; min-width:400px; float:left; border-top: 1px solid #d5e3ef;">
                    <div class="control-group" style=" padding-top: 10px;">
                        <div class="controls">
                            <button type="button" class="btn btn-sm btn-danger up">
                                <i class="icon-arrow-left"></i>
                                查看上一个版本
                            </button>
                            &nbsp; &nbsp; &nbsp;
                            <button type="button" class="btn btn-sm btn-danger next" disabled="">
                                <i class="icon-arrow-right"></i>
                                查看下一个版本
                            </button>
                            &nbsp; &nbsp; &nbsp;
                            <button type="button" class="btn btn-sm btn-danger" onclick="previous();">
                                <i class="icon-undo"></i>
                                返回
                            </button>
                        </div>
                    </div>
                </div>
            </form>
        </div>

        <script src="../../assets/js/jquery.js"></script>
        <script src="../../assets/js/plugin/bootstrap/js/bootstrap.min.js"></script>
        <script type='text/javascript' src="../../assets/js/plugin/jquery-ui/jquery-ui.js"></script>
        <!--<script src="../../assets/js/plugin/datepicker/js/jquery-datepicker.js"></script>-->
        <script src="../../assets/js/date-time/moment.js"></script>
        <script src="../../assets/js/date-time/daterangepicker.js"></script>
        <script src="../../assets/js/plugin/menu/menu.js"></script>
        <script src="../../assets/js/jquery.validate.js"></script>
        <script src="../../assets/js/jquery.validate-util.js"></script>
        <!--<script src="../../assets/js/logic/overlayer.js"></script>-->
        <script src="../../assets/js/Base64.js"></script>
        <script src="logic.js"></script>
        <script type="text/javascript">
                                var base64 = new Base64();
                                var type = getQueryString("type");
                                var DepotID = getQueryString("DepotID");
                                var DepotName = getQueryString("DepotName");
                                DepotName = base64.decode(DepotName);
                                var id = getQueryString("id");
                                var policyArray, policyAmount, actualQuantity;
                                $(function() {
                                    getAllPolicy();
                                    //初始化数据
                                    actualQuantity = policyAmount - 1;
                                    show_oldPolicy(policyArray, actualQuantity);
                                    if (actualQuantity == 0) {
                                        $(".up").attr("disabled", "");
                                    }
                                    if (actualQuantity == (policyAmount - 1)) {
                                        $(".next").attr("disabled", "");
                                    }
                                    $(".up").click(function() {
                                        actualQuantity = actualQuantity - 1;
                                        show_oldPolicy(policyArray, actualQuantity);
                                        $(".next").removeAttr("disabled");
                                        if (actualQuantity == 0) {
                                            $(".up").attr("disabled", "");
                                        }
                                    });
                                    $(".next").click(function() {
                                        actualQuantity = actualQuantity + 1;
                                        show_oldPolicy(policyArray, actualQuantity);
                                        $(".up").removeAttr("disabled");
                                        if (actualQuantity == (policyAmount - 1)) {
                                            $(".next").attr("disabled", "");
                                        }
                                    });
                                })
        </script>
    </body>
</html>
